-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send mattermost action #14
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, but it would be ideal if we adopted ERB templates for MM message templates (just like all other templates already).
lib/fastlane/plugin/ddg_apple_automation/actions/mattermost_send_message_action.rb
Outdated
Show resolved
Hide resolved
@ayoy updated to erb templates 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I added specs for verifying messages content - to be sure that messages are formatted correctly (we use the same for other ERB templates).
it "handles unsuccessful HTTP response" do | ||
allow(HTTParty).to receive(:post).and_return(double(success?: false, body: "Error message")) | ||
|
||
expect { Fastlane::Actions::MattermostSendMessageAction.run(params) }.to raise_error(FastlaneCore::Interface::FastlaneError, "Failed to send message: Error message") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This gets a bit verbose so we usually provide a helper function in the spec called e.g. run
, calling Fastlane::Actions::MattermostSendMessageAction.run
inside. See process_template
at the bottom of the file.
Task/Issue URL: https://app.asana.com/0/1205419239275955/1208297538472343/f
Description:
Template tests to mattermost